# npm 包

本文档展示了 Rsbuild 团队维护的所有 npm 包信息。

## @rsbuild/core

![](https://img.shields.io/npm/v/@rsbuild/core?style=flat-square&colorA=564341&colorB=EDED91)

Rsbuild 核心包，提供 CLI 命令和基于 Rspack 的构建能力。

- [npm](https://npmjs.com/package/@rsbuild/core)
- [源代码](https://github.com/web-infra-dev/rsbuild/tree/main/packages/core)
- [文档](/api/javascript-api/core)

## @rsbuild/plugin-react

![](https://img.shields.io/npm/v/@rsbuild/plugin-react?style=flat-square&colorA=564341&colorB=EDED91)

React 插件提供了对 React 的支持，插件内部集成了 JSX 编译、React Refresh 等功能。

- [npm](https://npmjs.com/package/@rsbuild/plugin-react)
- [源代码](https://github.com/web-infra-dev/rsbuild/tree/main/packages/plugin-react)
- [文档](/plugins/list/plugin-react)

## @rsbuild/plugin-vue

![](https://img.shields.io/npm/v/@rsbuild/plugin-vue?style=flat-square&colorA=564341&colorB=EDED91)

Vue 3 插件，提供对 Vue 3 SFC（单文件组件）的支持。

- [npm](https://npmjs.com/package/@rsbuild/plugin-vue)
- [源代码](https://github.com/web-infra-dev/rsbuild/tree/main/packages/plugin-vue)
- [文档](/plugins/list/plugin-vue)

## @rsbuild/plugin-vue-jsx

![](https://img.shields.io/npm/v/@rsbuild/plugin-vue-jsx?style=flat-square&colorA=564341&colorB=EDED91)

Vue 3 JSX 插件，提供对 Vue 3 JSX / TSX 语法的支持。

- [npm](https://npmjs.com/package/@rsbuild/plugin-vue-jsx)
- [源代码](https://github.com/web-infra-dev/rsbuild/tree/main/packages/plugin-vue-jsx)
- [文档](/plugins/list/plugin-vue-jsx)

## @rsbuild/plugin-vue2

![](https://img.shields.io/npm/v/@rsbuild/plugin-vue2?style=flat-square&colorA=564341&colorB=EDED91)

Vue 2 插件，提供对 Vue 2 SFC（单文件组件）的支持。

- [npm](https://npmjs.com/package/@rsbuild/plugin-vue2)
- [源代码](https://github.com/web-infra-dev/rsbuild/tree/main/packages/plugin-vue2)
- [文档](/plugins/list/plugin-vue2)

## @rsbuild/plugin-vue2-jsx

![](https://img.shields.io/npm/v/@rsbuild/plugin-vue2-jsx?style=flat-square&colorA=564341&colorB=EDED91)

Vue 2 JSX 插件，提供对 Vue 2 JSX / TSX 语法的支持。

- [npm](https://npmjs.com/package/@rsbuild/plugin-vue2-jsx)
- [源代码](https://github.com/web-infra-dev/rsbuild/tree/main/packages/plugin-vue2-jsx)
- [文档](/plugins/list/plugin-vue2-jsx)

## @rsbuild/plugin-eslint

![](https://img.shields.io/npm/v/@rsbuild/plugin-eslint?style=flat-square&colorA=564341&colorB=EDED91)

ESLint 插件，用于在编译过程中运行 ESLint 检查。

- [npm](https://npmjs.com/package/@rsbuild/plugin-eslint)
- [源代码](https://github.com/web-infra-dev/rsbuild/tree/main/packages/plugin-eslint)
- [文档](/plugins/list/plugin-eslint)

## @rsbuild/plugin-type-check

![](https://img.shields.io/npm/v/@rsbuild/plugin-type-check?style=flat-square&colorA=564341&colorB=EDED91)

Type check 插件，在单独的进程中运行 TypeScript 类型检查。

- [npm](https://npmjs.com/package/@rsbuild/plugin-type-check)
- [源代码](https://github.com/web-infra-dev/rsbuild/tree/main/packages/plugin-type-check)
- [文档](/plugins/list/plugin-type-check)

## @rsbuild/plugin-typed-css-modules

![](https://img.shields.io/npm/v/@rsbuild/plugin-typed-css-modules?style=flat-square&colorA=564341&colorB=EDED91)

为项目中的 CSS Modules 文件生成类型声明文件。

- [npm](https://npmjs.com/package/@rsbuild/plugin-typed-css-modules)
- [源代码](https://github.com/web-infra-dev/rsbuild/tree/main/packages/plugin-typed-css-modules)
- [文档](/plugins/list/plugin-typed-css-modules)

## @rsbuild/plugin-sass

![](https://img.shields.io/npm/v/@rsbuild/plugin-sass?style=flat-square&colorA=564341&colorB=EDED91)

Sass 插件，使用 Sass 作为 CSS 预处理器。

- [npm](https://npmjs.com/package/@rsbuild/plugin-sass)
- [源代码](https://github.com/web-infra-dev/rsbuild/tree/main/packages/plugin-sass)
- [文档](/plugins/list/plugin-sass)

## @rsbuild/plugin-less

![](https://img.shields.io/npm/v/@rsbuild/plugin-less?style=flat-square&colorA=564341&colorB=EDED91)

Less 插件，使用 Less 作为 CSS 预处理器。

- [npm](https://npmjs.com/package/@rsbuild/plugin-less)
- [源代码](https://github.com/web-infra-dev/rsbuild/tree/main/packages/plugin-less)
- [文档](/plugins/list/plugin-less)

## @rsbuild/plugin-stylus

![](https://img.shields.io/npm/v/@rsbuild/plugin-stylus?style=flat-square&colorA=564341&colorB=EDED91)

Stylus 插件，使用 Stylus 作为 CSS 预处理器。

- [npm](https://npmjs.com/package/@rsbuild/plugin-stylus)
- [源代码](https://github.com/web-infra-dev/rsbuild/tree/main/packages/plugin-stylus)
- [文档](/plugins/list/plugin-stylus)

## @rsbuild/plugin-source-build

![](https://img.shields.io/npm/v/@rsbuild/plugin-source-build?style=flat-square&colorA=564341&colorB=EDED91)

用于 monorepo 场景，支持引用其他子目录的源代码，并完成构建和热更新。

- [npm](https://npmjs.com/package/@rsbuild/plugin-source-build)
- [源代码](https://github.com/web-infra-dev/rsbuild/tree/main/packages/plugin-source-build)
- [文档](/plugins/list/plugin-source-build)

## @rsbuild/plugin-node-polyfill

![](https://img.shields.io/npm/v/@rsbuild/plugin-node-polyfill?style=flat-square&colorA=564341&colorB=EDED91)

Node Polyfill 插件，用于注入 Node 核心模块在浏览器端的 polyfills。

- [npm](https://npmjs.com/package/@rsbuild/plugin-node-polyfill)
- [源代码](https://github.com/web-infra-dev/rsbuild/tree/main/packages/plugin-node-polyfill)
- [文档](/plugins/list/plugin-node-polyfill)

## @rsbuild/plugin-image-compress

![](https://img.shields.io/npm/v/@rsbuild/plugin-image-compress?style=flat-square&colorA=564341&colorB=EDED91)

Image Compress 插件，将项目中用到的图片资源进行压缩处理。

- [npm](https://npmjs.com/package/@rsbuild/plugin-image-compress)
- [源代码](https://github.com/web-infra-dev/rsbuild/tree/main/packages/plugin-image-compress)
- [文档](/plugins/list/plugin-image-compress)

## @rsbuild/plugin-mdx

![](https://img.shields.io/npm/v/@rsbuild/plugin-mdx?style=flat-square&colorA=564341&colorB=EDED91)

提供 MDX 支持。

- [npm](https://npmjs.com/package/@rsbuild/plugin-mdx)
- [源代码](https://github.com/web-infra-dev/rsbuild/tree/main/packages/plugin-mdx)
- [文档](/plugins/list/plugin-mdx)

## @rsbuild/plugin-check-syntax

![](https://img.shields.io/npm/v/@rsbuild/plugin-check-syntax?style=flat-square&colorA=564341&colorB=EDED91)

Check Syntax 插件，用于分析产物的语法兼容性，判断是否存在导致兼容性问题的高级语法。

- [npm](https://npmjs.com/package/@rsbuild/plugin-check-syntax)
- [源代码](https://github.com/web-infra-dev/rsbuild/tree/main/packages/plugin-check-syntax)
- [文档](/plugins/list/plugin-check-syntax)

## @rsbuild/plugin-pug

![](https://img.shields.io/npm/v/@rsbuild/plugin-pug?style=flat-square&colorA=564341&colorB=EDED91)

提供对 Pug 模板引擎的支持。

- [npm](https://npmjs.com/package/@rsbuild/plugin-pug)
- [源代码](https://github.com/web-infra-dev/rsbuild/tree/main/packages/plugin-pug)
- [文档](/plugins/list/plugin-pug)

## @rsbuild/plugin-rem

![](https://img.shields.io/npm/v/@rsbuild/plugin-rem?style=flat-square&colorA=564341&colorB=EDED91)

用于实现移动端页面的 rem 自适应布局。

- [npm](https://npmjs.com/package/@rsbuild/plugin-rem)
- [源代码](https://github.com/web-infra-dev/rsbuild/tree/main/packages/plugin-rem)
- [文档](/plugins/list/plugin-rem)

## @rsbuild/plugin-umd

![](https://img.shields.io/npm/v/@rsbuild/plugin-umd?style=flat-square&colorA=564341&colorB=EDED91)

用于构建 UMD 格式的产物。

- [npm](https://npmjs.com/package/@rsbuild/plugin-umd)
- [源代码](https://github.com/web-infra-dev/rsbuild/tree/main/packages/plugin-umd)
- [文档](/plugins/list/plugin-umd)

## @rsbuild/plugin-yaml

![](https://img.shields.io/npm/v/@rsbuild/plugin-yaml?style=flat-square&colorA=564341&colorB=EDED91)

用于引用 YAML 文件，并将其转换为 JavaScript 对象。

- [npm](https://npmjs.com/package/@rsbuild/plugin-yaml)
- [源代码](https://github.com/web-infra-dev/rsbuild/tree/main/packages/plugin-yaml)
- [文档](/plugins/list/plugin-yaml)

## @rsbuild/plugin-toml

![](https://img.shields.io/npm/v/@rsbuild/plugin-toml?style=flat-square&colorA=564341&colorB=EDED91)

用于引用 TOML 文件，并将其转换为 JavaScript 对象。

- [npm](https://npmjs.com/package/@rsbuild/plugin-toml)
- [源代码](https://github.com/web-infra-dev/rsbuild/tree/main/packages/plugin-toml)
- [文档](/plugins/list/plugin-toml)

## @rsbuild/plugin-assets-retry

![](https://img.shields.io/npm/v/@rsbuild/plugin-assets-retry?style=flat-square&colorA=564341&colorB=EDED91)

用于在静态资源加载失败时自动发起重试请求。

- [npm](https://npmjs.com/package/@rsbuild/plugin-assets-retry)
- [源代码](https://github.com/web-infra-dev/rsbuild/tree/main/packages/plugin-assets-retry)
- [文档](/plugins/list/plugin-assets-retry)

## @rsbuild/plugin-basic-ssl

![](https://img.shields.io/npm/v/@rsbuild/plugin-basic-ssl?style=flat-square&colorA=564341&colorB=EDED91)

为 HTTPS server 生成不受信任的自签名证书。

- [npm](https://npmjs.com/package/@rsbuild/plugin-basic-ssl)
- [源代码](https://github.com/web-infra-dev/rsbuild/tree/main/packages/plugin-basic-ssl)
- [文档](/plugins/list/plugin-basic-ssl)

## @rsbuild/shared

![](https://img.shields.io/npm/v/@rsbuild/shared?style=flat-square&colorA=564341&colorB=EDED91)

Rsbuild 内部使用的公共模块和 helpers。

- [npm](https://npmjs.com/package/@rsbuild/shared)
- [源代码](https://github.com/web-infra-dev/rsbuild/tree/main/packages/shared)

:::warning
`@rsbuild/shared` 是 Rsbuild 内部使用的，请避免在 Web 项目或社区插件中依赖 `@rsbuild/shared` 导出的方法。

如果你需要使用 `@rsbuild/shared` 里的方法，可以直接拷贝相关代码到项目中，也可以通过 issues 反馈，我们会评估是否需要提供对外的 API。
:::

## create-rsbuild

![](https://img.shields.io/npm/v/create-rsbuild?style=flat-square&colorA=564341&colorB=EDED91)

用于创建 Rsbuild 新项目。

- [npm](https://npmjs.com/package/create-rsbuild)
- [源代码](https://github.com/web-infra-dev/rsbuild/tree/main/packages/create-rsbuild)
